package com.software.demo3.entity;

import java.util.Date;

public class User {
    private String userId;
    // 只限于与数据库，不作为业务逻辑处理
    private String userName;
    private String firstName;
    private String lastName;
    private String password;
    private Date loginTime;

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return this.firstName + this.lastName;
    }

    public void setUserName(String userName) {
        // 以空格来区是前还后
        String[] nameArray = userName.split(" ");
        this.firstName = nameArray[0];
        this.lastName = nameArray[1];
    }

    public String getFirstName() {
        return firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public String getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Date getLoginTime() {
        return loginTime;
    }

    public void setLoginTime(Date loginTime) {
        this.loginTime = loginTime;
    }
}
